package com.spzx.product.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.page.TableDataInfo;
import com.spzx.product.api.domain.SkuQuery;
import com.spzx.product.api.service.RemoteProductService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteProductFallbackFactory implements FallbackFactory<RemoteProductService> {

    @Override
    public RemoteProductService create(Throwable cause) {
        return new RemoteProductService() {
            @Override
            public R<TableDataInfo> skuList(Integer pagetNum, Integer pageSize, SkuQuery skuQuery, String source) {
                return R.fail("商品远程调用失败");
            }
        };
    }
}
